date_isodate_set
DateTime::setISODate alias - Set ISO date
date_isodate_set()
function sets dates according to the ISO 8601 standard, using week and day offsets (rather than using a specific date).
Set the ISO date for Week 5 of 2016:
<?php $date = date_create ( ) ; date_isodate_set ( $date , 2016 , 5 ) ; echo date_format ( $date , "Ymd" ) ; ?>
Try it yourself
date_isodate_set ( object , year , week , day ) ;
parameter | describe |
---|---|
object | Required. Specifies the DateTime object returned by date_create() . |
year | Required. The year in the specified date. |
week | Required. Weeks of the specified date. |
day | Optional. Specify the offset from the first day of the week. The default is 1. |